const __POOL_CACHE__ = {};

define([
  'require'
], function (require) {
  'use strict';

  function putToPool (poolName, item) {
    var pool = __POOL_CACHE__[poolName];
    if (!pool) {
      pool = [];
      __POOL_CACHE__[poolName] = pool;
    }

    pool.push(item);
  }

  function getFromPool (poolName) {
    var pool = __POOL_CACHE__[poolName];
    if (!pool || pool.length == 0) {
      return null;
    } else {
      return pool.shift();
    }
  }

  return {
    put: putToPool,
    get: getFromPool
  }

});